<template>
    <div id="lf-container" ref="container"></div>
  </template>
  
  <script>
  import LogicFlow from '@logicflow/core'
  import "@logicflow/core/lib/style/index.css";
  import CustomNode from './nodes/CustomNode'
  
  export default {
    mounted() {
      this.initLogicFlow()
    },
    methods: {
      initLogicFlow() {
        const lf = new LogicFlow({
          container: this.$refs.container,
          grid: true,
          width: 800,
          height: 500
        })
        
        // 注册自定义节点
        lf.register(CustomNode)
        
        // 渲染示例
        lf.render({
          nodes: [
            {
              id: 'node1',
              type: 'custom-node',
              x: 200,
              y: 200,
              text: '特殊节点',
              properties: {
                priority: 'high'
              }
            }
          ]
        })
      }
    }
  }
  </script>